﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Configuration;
using System.Web.Security;
using mBlog.Admin.ViewModels;
using mBlog.Services;

namespace mBlog.Admin.Controllers
{
    public class HomeController : AdminBaseController
    {

        private IPostService postService;
        private ICategoryService categoryService;
        private ITagService tagService;

        public HomeController(IPostService pService, ICategoryService caService,
            ITagService tService)
        {
            this.postService = pService;
            this.categoryService = caService;
            this.tagService = tService;
        }

        //
        // GET: /Admin/

        public ActionResult Index()
        {
            AdminHomeView homeView = new AdminHomeView();

            homeView.PostCount = postService.Count();
            homeView.CategoryCount = categoryService.Count();
            homeView.TagCount = tagService.Count();

            return View(homeView);
        }
    }
}
